* if only arg1 is passed, return var named "arg1" ($_SESSION['res'][$currentResource][$arg1]
* if arg1 and arg2 are passed, return "arg2" index from "arg1" array ($_SESSION['res'][$currentResource][$arg1][$arg2] (use cfRSetVarArray to define array)
* if arg1, arg2 and arg3 are passed, return "arg3" index from "arg1" / "arg2" array ($_SESSION['res'][$currentResource][$arg1][$arg2][$arg3] (use cfRSetVarArray to define array)
* @param string $arg1 : var or array name
* @param string $arg2 : (optional) var or array name
* @param string $arg3 : (optional) var name
* @param string $notFound : (optional) returned value when not found
* @return mixed value
*/
function &cfRGetVar($arg1=false, $arg2=false, $arg3=false, $notFound=false){
static $memCached=false;
static $resourceId=false;
// If session not started or no active resource, return false
'send' : send authorisation through P2P app (dir or file)
* @param string $completeFilename : name of dir or file
* @param string $item : right to check ('read', 'download'...), leave to false to retrieve full rights array;
* @param boolean $unsafeDir: set to false to indicate than file or folder's directory is clean and allowed, set to true to perform full check
* @param boolean $itemInSubDir: used only for "list" sharedMode with $unsafeDir=true: true to indicate that item is in a subdir, false if item is directly within shared items
* @desc Return an array of given file or dir rights. If $item is provided, only right corresponding to item is returned,
*/
function cfFileRights($completeFilename, $item=false, $unsafeDir=true, $itemInSubDir=NULL){
static $cache;
// Cache function main data
if(!isset($cache)){
$cache=array();
// Resource specific file rights functions : create function
// As userDir is a subdir of installation directory (which is a protected dir), access rights are granted through 'userTempDirAccessAllowed' resource data
// If userTempDirAccessAllowed is set to true, user may read/write data located in his temp dir (data/sessionData/"session ID"), (no modify...)
if($unsafeDir || $isdir){
if($cache['userTempDirAccessAllowed'] && cfIsSubDir(cfAppUserTempDir(false),$completeFilename)){// if user may access his temp dir
// as resource Dir is a subdir of installation directory (which is a protected dir), access rights are granted through 'resourceDataDirAccessAllowed' resource data
// if resourceDataDirAccessAllowed is set to true, user may read data located in resource datadir (data/sessionData/"session ID"), (no modify...)
if($cache['resourceDataDirAccessAllowed'] && cfIsSubDir($cache['resourceDataDir'],$completeFilename)){// if user may access resource data dir
'2: thumbnail(s) path (if source is .jpg, filename of output) or "check" to see if a thumbnail can be generated
'3: max width
'4: max height
'5: filter ("images" for imgas only or "all" to try to generate thumbnails from all files or "check" to see if a thumbnail can be generated) (default: images)
'6: extra processing : "crop" (for crop with external zoom factor), "square" (for 1/1 crop) or "no" to preserve input ratio
$addressMode == "absolute" : generate adress with host name (used for files accessed by external programs (winamp, media player..., which don't have session cookie))
* @param string $preUTF8Encode : true to utf8 encode complete filename, b64 to base64 encode, false not to encode
*/
function cfExtVideo($completeFilename, $complement=array(), $addressMode="relative", $preUTF8Encode=true){
$sep='.';
if(!is_array($complement)) $complement=array();
// replace # by *weezoSharp* (Media player problem with # symbol...)
* @param array $options: extra options array (icon=>1 to extract icon of file,'noDC'=>1 not to get audio cover from dir,'crop'=>1 to crop image to get a square)
* @param array $rawFilename: set to true not to b64 encode filename (used to generate a javascript modifiable address)
* @return string: URL
*/
function cfExtImage($completeFilename,$width=false,$height=false, $cache=true, $rotation=0, $options=false, $rawFilename=false){